import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import replace from '@rollup/plugin-replace'
import externalGlobals from 'rollup-plugin-external-globals'


// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  optimizeDeps: {
    exclude: ['env']
  },
  build: {
    emptyOutDir: false,
    target: 'chrome69',
    rollupOptions: {
      plugins: [
        replace({
          values: {
            'process.env.NODE_ENV': '"production"'
          },
          preventAssignment: true
        }),
        externalGlobals({
          vue: 'Vue'
        })
      ]
    }
  }
})
